package com.sitanyun.merchant.guide.frament.presenter.impl;

import com.sitanyun.merchant.guide.frament.model.impl.ShtopFModelImpl;
import com.sitanyun.merchant.guide.frament.model.inter.IShtopFModel;
import com.sitanyun.merchant.guide.frament.presenter.inter.IShtopFPresenter;
import com.sitanyun.merchant.guide.frament.view.inter.IShtopFView;
import com.sitanyun.merchant.guide.presenter.callback.CallBack;

public class ShtopFPresenterImpl implements IShtopFPresenter {
    private IShtopFView mIShtopFView;
    private IShtopFModel mIShtopFModel;

    public ShtopFPresenterImpl(IShtopFView fIShtopFView) {
        mIShtopFView = fIShtopFView;
        mIShtopFModel = new ShtopFModelImpl();
    }

    @Override
    public void getquery(String queryMonth, String queryType) {
        mIShtopFModel.setquery(queryMonth, queryType, new CallBack() {
            @Override
            public void onSuccess(Object response) {
                mIShtopFView.response(response,IShtopFView.RESPONSE_ONE);
            }

            @Override
            public void onError(Throwable t) {
                mIShtopFView.response(t,IShtopFView.RESPONSE_TWO);
            }
        });
    }
}
